package com.huang.Controller;

import com.huang.Pojo.Order;
import com.huang.Pojo.Product;
import com.huang.Service.FeignClientService;
import com.huang.Service.OrderService;
import com.huang.Service.ServiceImpl.OrderServiceImpl04;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;


@RestController
public class controller03 {
    //    public static final String Product_Url="http://service-product";

    @Resource
    private OrderService orderService;

    @Resource
    private RestTemplate restTemplate;

    @Resource
    private FeignClientService feignClientService;

    @Resource
    private OrderServiceImpl04 orderServiceImpl04;

    @GetMapping(value = "/order/seata/{pid}")
    public Order order(@PathVariable("pid") Integer pid){
        Order order = orderServiceImpl04.createOrder(pid);
//        if (order != null){
//            return "order有值";
//        }else{
//            return "order异常";
//        }
        return order;

    }
}
